/**************************************************************************
 * $RCSfile: $  $Revision: $  $Date:  $
 *
 * $Log: $
 **************************************************************************/
/*
 * Copyright 2008 gxlu, Inc. All rights reserved.
 * File name : ResBundleUtil.java
 * Created on : Dec 9, 2013 5:04:09 PM
 * Creator : freeyfh
 */
package com.simplefan.common.util;

import java.util.Locale;
import java.util.ResourceBundle;

/**
 * <pre>
 * Description : TODO
 * @author freeyfh
 * </pre>
 */
public class ResBundle {
  static String message = "messages";
  static String var = "var";

  public static String getLanguageBundle(String baseName){
    String[] language = SystemConstant.getLanguage().split("_");
    Locale locale = null;
    if(language.length>1){
      locale = new Locale(language[0],language[1]);
    }else{
      locale = new Locale(language[0]);
    }
    return ResourceBundle.getBundle(message, locale).getString(baseName);
  }
  
  public static String getSystemVar(String varName){
    Locale locale = new Locale(var);
    return ResourceBundle.getBundle(var, locale).getString(varName);
  }
  
  public static String JSON_SIGN_HIDDEN = "JSON_SIGN_HIDDEN";
  public static String JSON_SIGN_RELATION = "JSON_SIGN_RELATION";
  public static String JSON_HIDDEN_ATTRS = "JSON_HIDDEN_ATTR";
}

